/* GUI CONVERTED from reupopst.p (converter v1.75) Sat Aug 12 23:10:03 2000 */
/* reupopst.p - ROUTINE TO UPDATE OPERATION HISTORY STD RUN TIME         */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                   */
/* All rights reserved worldwide.  This is an unpublished work.          */
/*V8:ConvertMode=Maintenance                                             */
/*K1Q4*/ /*V8:WebEnabled=No                                              */
/* Revision: 7.4      CREATED: 09/16/97         By: *H1F7* Felcy D'Souza */
/* Revision: 8.6     MODIFIED: 05/20/98         By: *K1Q4* Alfred Tan    */
/* Revision: 9.1     MODIFIED: 08/12/00         By: *N0KP* myb           */
/***************************************************************************/


     /* THE PURPOSE OF THIS ROUTINE IS TO UPDATE THE STD RUN TIME IN*/
     /* OPERATION HISTORY WITH THE ALTERNATE WORK CENTER RUN RATE   */
     /* WHEN THE WORK CENTER OR MACHINE DEFINED IN THE TRANSACTION  */
     /* IS DIFFERENT FROM THE ONE DEFINED IN WORK ORDER ROUTING.    */

     /* THIS ROUTINE IS CALLED BY THE FOLLOWING TRANSACTIONS:       */
         /* ADV. REPETITIVE BACKFLUSH TRANSACTION (18.22.13 - rebkfl.p) */
         /* ADV. REPETITIVE REWORK TRANSACTION    (18.22.17 - rework.p) */
         /* REPETITIVE LABOR TRANSACTION          (18.14 - reoptr10.p)  */
         /* REPETITIVE REWORK TRANSACTION         (18.14 - reoptr13.p)  */
     /* LABOR FEEDBACK BY WORK ORDER          (17.1  - sfoptr01.p)  */
     /* LABOR FEEDBACK BY EMPLOYEE ORDER      (17.2  - sfoptr02.p)  */
     /* LABOR FEEDBACK BY WORK CENTER         (17.3  - sfoptr03.p)  */

         /*
         Parameter:
         I/O    Name          Like   Description
         -----  ------------  -----  --------------------
         input  ophist_recid  recid  Record id of op_hist
         */

         define input parameter ophist_recid as recid no-undo.

         find op_hist exclusive-lock where recid(op_hist) = ophist_recid.
     if available op_hist then
         find wo_mstr where wo_lot = op_wo_lot
              no-lock no-error.
         find wcr_route where wcr_part    = (if wo_routing > "" then
                            wo_routing
                             else wo_part)
                          and wcr_wkctr   = op_wkctr
                          and wcr_mch     = op_mch
                          and wcr_op      = op_wo_op
                  no-lock no-error.
         if available wcr_route then
     do:
        if wcr_rate <> 0 then op_std_run = 1 / wcr_rate.
     end. /* IF AVAILABLE wcr_route */
